package com.example.domain.entity;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 软删除实体类 - 继承审计字段并添加软删除字段
 */
@Data
@EqualsAndHashCode(callSuper = true)
@MappedSuperclass
public abstract class SoftDeleteEntity extends BaseEntity {

    @Column(name = "is_deleted", columnDefinition = "TINYINT(1) DEFAULT 0")
    private Boolean isDeleted = false;

    @Column(name = "deleted_at")
    private LocalDateTime deletedAt;

    @Column(name = "deleted_by", length = 50)
    private String deletedBy;
}

